﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace UFrame
{
    public class SpriteLifebar : MonoBehaviour
    {
        public SpriteRenderer fill;

        public void SetRatio(float val)
        {
            int type = fill.material.GetInt("_FillMethod");
            if (type == 1 || type == 2)
            {
                fill.material.SetFloat("_FillAmount", val);
            }
            else
            {
                int max = 360;
                fill.material.SetFloat("_Arc1", max - max * val);
            }
        }
    }
}